/*
 *  \file GreedyHeuristic.h
 *  GRE
 *
 *  Created by Kutlak Roman on 28/08/2011.
 *  Copyright 2011 University of Aberdeen. All rights reserved.
 *
 */

#ifndef GreedyHeuristic_h 
#define GreedyHeuristic_h

// PROJECT INCLUDES 
#include "Algorithm.h"
#include "KnowledgeBase.h"
#include "Ontology.h"


#ifdef DEBUG
#define GH_DEBUG 0
#endif

namespace kutlak {
namespace roman {
namespace gre {
    
    /*!
     * \brief Implementation of the Dale 1992 Greedy algorithm. 
     *  The algorithm is an aproximation to the full brevity
     *  but the generated REs are not always the shortest possible ones.
     */
    class GreedyHeuristic : public Algorithm { 
    public: 
#pragma mark -
#pragma mark lifecycle
        
        GreedyHeuristic(const pKnowledgeBase& kb = pKnowledgeBase(),
                        const pOntology& ontology = pOntology());
        
        GreedyHeuristic(const GreedyHeuristic& from) = delete;
        GreedyHeuristic& operator=(const GreedyHeuristic& from) = delete;
        
        virtual ~GreedyHeuristic(void);
        
#pragma mark -
#pragma mark operations
        virtual RefExp MakeReferringExpression(const EntityPtrT& referent, 
                                               ContainerT distractors);
        
        virtual RefExp MakeReferringExpression(const std::string& referent);
    };
}
}
}
#endif // GreedyHeuristic_h
